home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_18_1987_Transactor_Publishing.d64
/
robot controller
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
4KB
|
115 lines
1 rem *********************************
2 rem ** mobile armatron software **
3 rem ** name: robot **
4 rem ** (c) 1986, jjb **
5 rem ** manalapan, nj 07726 **
6 rem ** v 860928 **
7 rem *********************************
10 dim a(12),b(250,1):gosub 3000:gosub 5000:poke 56579,255:poke 56577,0
20 a(1)=38:a(2)=70:a(3)=36:a(4)=34:a(5)=33:a(6)=65
30 a(7)=40:a(8)=72:a(9)=48:a(10)=80:a(11)=66:a(12)=68
40 ss$="1234567890+-":rc$=chr$(5)+chr$(18)
50 gosub 3000:ro=6:co=10:gosub 5050:printrc$;" m a i n m e n u "
60 print:printtab(12);"< f1 >: learn":print:printtab(12);"< f3 >: do"
70 print:printtab(12);"< f5 >: save":print:printtab(12);"< f7 >: retrieve"
80 print:printtab(10);"<ctrl> q: quit (end)
90 ro[178]19:co[178]10:[141] 5050:[153]"which... "
100 [161] sr$:[139] sr$[178]"" [167] 100
110 sr[178][198](sr$)[171]132:[139] sr[178][171]115 [167] sr[178]5
120 [139] sr[179]1 [176] sr[177]5 [167] 90
130 [145] sr [141] 200,300,400,600,800
140 [137] 50
200 [141] 1000:j[178]b(0,0):x[178]0:[143]*** learn mode ***
210 [161] a$:[139] a$[178]"" [167] 210
220 [139] [198](a$)[178]133 [167] [142]
230 [141] 2000:[139] i[178]0 [167] [151] 56577,0:[137] 210
240 [151] 56577,a(i)
250 [161] a$:[139] a$[178]"" [167] x[178]x[170]1:[137] 250
260 [151] 56577,0
270 j[178]j[170]1:b(j,0)[178]i:b(j,1)[178]x:x[178]0:b(0,0)[178]j
280 ro[178]i[170]10:co[178]5:[141] 5050:[153] [202](ss$,i,1);:[137] 210
300 [143]** do procedure
310 [153][199](147):[153]bl$:[153]" do procedure":[153]bl$:[153]
320 [139] b(0,0)[178]0 [167] [153]"no procedure in memory.":[137] 375
330 [153]"press any key to begin procedure."
340 [161] a$:[139] a$[178]"" [167] 340
350 [153]"procedure execution in progress"
355 [129] i[178]1 [164] b(0,0):[151] 56577,a(b(i,0))
360 [129] j[178]1 [164] b(i,1)
365 [161] a$:[139] a$[178]"" [167] x[178]x[170]1:[130] j
370 [151] 56577,0:[129] j[178]1 [164] 500:[130] j:[130] i:[153]"procedure done."
375 ro[178]18:co[178]0:[141]5050:[153]"press any key to return to the menu."
380 [161] a$:[139] a$[178]"" [167] 380
390 [142]
400 [143]** save procedure
410 [153][199](147):[153]bl$:[153]" save procedure":[153]bl$:[153]
420 [139] b(0,0)[178]0 [167] [153]"no procedure in memory.":[137] 480
430 [133]"enter file name to save";f$
440 [159] 1,8,15:[159] 2,8,2,"@0:"[170]f$[170]",s,r":[132]1,e,ed$,tn,bl:[160] 1:[160] 2
450 [139] e[178]62 [167] 500
460 [153]"file exists. continue (y/n)...";:[141] 1500
470 [139] a$[178]"y" [167] 500
480 [153]"abort. press any key..."
490 [161] a$:[139] a$[178]"" [167] 490
495 [142]
500 [159] 2,8,2,"@0:"[170]f$[170]",s,w":[153]:[153]"saving procedure. wait."
510 [129] i[178]0 [164] b(0,0):[152]2,b(i,0):[152]2,b(i,1):[130] i:[160] 2:[160] 15
520 [153]:[153]"procedure saved. press any key.":[137] 490
600 [143]** retrieve procedure
610 [153][199](147):[153]bl$:[153]" retrieve procedure":[153]bl$:[153]
620 [139] b(0,0)[178]0 [167] 650
630 [153]"procedure in memory. continue (y/n)?";:[141] 1500
640 [139] a$[178]"n" [167] [153]"abort. ";:[137] 700
650 [133]"enter file name to retrieve";f$
660 [159] 1,8,15:[159] 2,8,2,"@0:"[170]f$[170]",s,r":[132]1,e,ed$,tn,bl:[160] 1:[160] 2
670 [139] e[178]0 [167] 720
680 [139] e[178]62 [167] [153]"file doesn't exist. ";
690 [153]"press any key."
700 [161] a$:[139] a$[178]"" [167] 700
710 [142]
720 [153]"retrieving procedure. wait.":[159] 2,8,2,"@0:"[170]f$[170]",s,r"
730 [132]2,b(0,0):[132]2,b(0,1)
740 [129] i[178]1 [164] b(0,0):[132]2,b(i,0):[132]2,b(i,1):[130]:[160] 2
750 [153]"retrieval complete. ";:[137] 690
800 [143]** end
810 ro[178]5:co[178]10:[141] 5050:[129] q[178]1 [164] 16:[153] [163]10);b$:[130]
820 ro[178]10:co[178]0:[141] 5050:[160]1:[160]2
830 [153]"program ended. to re-enter, type goto 50";
840 [153]:[128]
1000 [143]** learn mode screen
1005 [153][199](147):[153]bl$
1006 [153]" mobile armatron robot learn mode ":[153]bl$:[153]
1007 [153]" press key to do function. press anyother key to stop.";
1008 [153]" press <f1> to returnto menu.":[153]
1009 [153]" key function":[153]" --- --------------------"
1010 [153][163]5);"1 = forward":[153][163]5);"2 = backward"
1020 [153][163]5);"3 = right forward turn":[153][163]5);"4 = left forward turn"
1030 [153][163]5);"5 = arm up":[153][163]5);"6 = arm down"
1040 [153][163]5);"7 = wrist up":[153][163]5);"8 = wrist down"
1050 [153][163]5);"9 = hand turn":[153][163]5);"0 = fingers move in/out"
1060 [153][163]5);"+ = right reverse turn"
1070 [153][163]5);"- = left reverse turn"
1080 [142]
1500 [161] a$:[139] a$[178]"" [167] 1500
1510 a$[178][199]([198](a$) [175] 223)
1520 [139] a$[179][177]"y" [175] a$[179][177]"n" [167] 1500
1530 [153] a$:[142]
2000 [143]** position in string
2010 [129] i[178]1 [164] 12:[139] a$[178][202](ss$,i,1) [167] 2030
2020 [130]:i[178]0:[142]
2030 ro[178]i[170]10:co[178]5:[141] 5050:[153]rc$;a$:[142]
3000 [143]** format screen=
3010 [151] 53280,6:[151] 53281,6:[153][199](147):b$[178][199](5)[170][199](18)
3020 bl$[178]b$[170]" ":[153] bl$
3030 [153] b$;" mobile armatron robot controller "
3040 [153]bl$
3050 b$[178]" "
3060 [142]
5000 [143]* cursor control using plot kernel ($fff0)
5010 [131] 162,0,160,0,24,32,240,255,96,999
5020 a[178]49300:sc[178]a
5030 [135] b:[139] b[179][177]999 [167] [151] a,b:a[178]a[170]1:[137] 5030
5040 [142]
5050 [151] sc[170]3,col:[151] sc[170]1,row:[158] sc
5060 [142]